package com.supermap.dataservice.project.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
 * @author aqua
 * @description
 * @date 2018年11月08 下午 1:30
 * @email 1301584033@qq.com
 */
@Mapper
public interface ChinaProject {

    /**
     * 获取全国最新
     * */
    @Select("select t1.areaname,if(tt.num is null,0,tt.num) as id,t1.lon as longitude,t1.lat as latitude \n" +
            " from  t_area t1 left join  (select left(t2.depareacode,2) \n" +
            "as areacode ,count(t4.id) num from t_s_depart t2 inner join \n" +
            "t_b_productgroup t3 on  FIND_IN_SET(t2.ID,t3.production_unitid) \n" +
            "inner join t_b_pms_product t4 on t3.id = t4.product_group and date(t4.create_date) > curdate() \n" +
            "group by left(t2.depareacode,2))  tt \n" +
            "on t1.areacode = tt.areacode where length(t1.areacode) = 2")
    List<Map<String,Object>> getnewDateAllProductCount();


}
